/*
 * powersys.cc
 *
 *  Created on: 12 Mar, 2009
 *      Author: suren
 */

#include "powersys.h"
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <vector>
using namespace std;

//definition of "bus" class methods
bus::bus(string inputLine){
  istringstream istr(inputLine);
  istr>>busNumber>>busType;
  istr>>loadMW>>loadMVAR;
  istr>>shuntConductance>>shuntSusceptance;
  istr>>lossFlowArea;
  istr>>finalVoltage>>finalDegree;
  istr>>BaseVoltage;
  istr>>lossFlowZone;
  istr>>maxV>>minV;
}

//defnition of "branch" class methods
branch::branch(string inputLine,int i){
  istringstream istr(inputLine);
  branchId = i;
  istr>>firstBus>>secondBus;
  istr>>lineResistance>>lineReactance>>lineCharging;
  istr>>lineMVARating>>lineMVARatingshort>>lineMVARatingEmergency;
  istr>>transformerRatio>>transformerAngle;
  istr>>status;
}


//defnition of "generator" class methods
generator::generator(string inputLine){
  istringstream istr(inputLine);
  istr>>busId>>Pg>>Qg;
  istr>>realPowerOutput>>reactivePowerOutput;
  istr>>maxQ>>minQ;
  istr>>voltageSetPoint>>MVABase;
  istr>>status;
  istr>>maxP>>minP;
}

vector<double> constructRandomVector(vector<struct bus> &Buses, vector<struct branch> &Branches, int i){
  return vector<double>();
}



